package com.lxit.util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/1/2.
 */
public class JsonUtil {
    //返回正确的json格式
    public static Map<String, Object> success(Object data) {
        Map<String, Object> result = new HashMap<String, Object>();
        result.put("state", "success");
        result.put("data", data);
        return result;
    }

    //返回错误的json格式
    public static Map<String, Object> error(String msg, Object data) {
        Map<String, Object> result = new HashMap<String, Object>();
        result.put("state", "error");
        result.put("msg", msg);
        result.put("data", data);
        return result;
    }
}
